import Vue from "vue";
import VueRouter from "vue-router";
import TheIndex from "../views/TheIndex";
import UserComment from "../views/UserComment";
import CourseList from "../views/CourseList";
import LogIn from "../views/LogIn";
import MyCourse from "../views/MyCourse";
import TheOptions from "../views/TheOptions";
import ToRegister from "../views/ToRegister";
import ToStudy from "../views/ToStudy";
import TeacherDetail from "../views/TeacherDetail";
import UserInfo from "../views/UserInfo";
import AreaWeather from "../views/AreaWeather";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/theIndex",
  },
  {
    path: "/theIndex",
    name: "theIndex",
    component: TheIndex,
  },
  {
    path: "/userComment",
    name: "userComment",
    component: UserComment,
  },
  {
    path: "/courseList",
    name: "courseList",
    component: CourseList,
  },
  {
    path: "/logIn",
    name: "logIn",
    component: LogIn,
  },
  {
    path: "/myCourse",
    name: "myCourse",
    component: MyCourse,
  },
  {
    path: "/theOptions",
    name: "theOptions",
    component: TheOptions,
  },
  {
    path: "/toRegister",
    name: "toRegister",
    component: ToRegister,
  },
  {
    path: "/toStudy",
    name: "toStudy",
    component: ToStudy,
  },
  {
    path: "/teacherDetail",
    name: "teacherDetail",
    component: TeacherDetail,
  },
  {
    path: "/userInfo",
    name: "userInfo",
    component: UserInfo,
  },
  {
    path: "/areaWeather",
    name: "areaWeather",
    component: AreaWeather,
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
